This application is related to the following co-pending and commonly assigned patent applications:
U.S. patent application Ser. No. 09/253,386, filed on Feb. 19, 1999, by Mark Z. Kumbler, entilted xe2x80x9cPOSTSCRIPT IMAGE PRINTING USING A DOWNLOADED HANDLERxe2x80x9d; and
U.S. patent application Ser. No. 09/253,821, filed on Feb. 19, 1999, by Mark Z. Kumbler, entilted xe2x80x9cACCURATE AND RELIABLE PAGE SIZE SELECTION IN A POSTSCRIPT OUTPUT DEVICExe2x80x9d;
which applications are incorporated by reference herein.
1. Field of the Invention
The present invention relates generally to computer-implemented printing systems, and in particular, to a method for performing a Control B protocol for PostScript(trademark) devices.
2. Description of the Related Art
PostScript(trademark) is a general purpose computer language developed by Adobe Systems, Inc. that has become a standard for device-independent output. PostScript(trademark) is most commonly used for supplying page description information to output devices such as printers and can describe elements including text, graphics, and scanned images.
PostScript(trademark) uses several different protocols to communicate over a serial or parallel link between a computer and a printer (or other devices). The protocols include: standard protocol, binary communications protocol (BCP), and tagged binary communications protocol (TBCP). These protocols are defined in the publication entitled xe2x80x9cAdobe Serial and Parallel Communications Protocols Specificationxe2x80x9d, Adobe Systems, Inc., Nov. 20, 1992, which publication is incorporated by reference herein.
The binary communications protocol is a bi-directional method of communicating between the computer and the printer, where neither device is considered to be a slave of the other. Any of the 256 possible 8-bit values may be transmitted as data between the devices, but certain character codes are used for specifying control functions that include flow control, status requests, aborting of jobs, and end-of-file markers.
The control functions include four that are asynchronous with the data stream and one that is synchronous with the data stream. The asynchronous control functions are:
Job status request. The receiving device (e.g., printer) should respond immediately to job status request from the sending device (e.g., computer) by sending appropriate data back to the sending device. The syntax and semantics of the returned information are not specified by the protocol.
Job abort request. The receiving device should respond immediately to job abort control from the sending device by terminating processing of the current job and flushing through the input stream until an end-of-file marker or end-protocol sequence is encountered. The receiving device should proceed at that point with processing the end-of-file or end-protocol in the normal manner.
XON flow control. The device receiving an XON may resume transmitting data that was blocked by a preceding XOFF. The XON and XOFF functions are present to support the well-established XON/XOFF flow control protocol used over asynchronous serial communications channels.
XOFF flow control. The device receiving an XOFF should cease transmitting data as quickly as possible. It may still transmit asynchronous control functions, especially XOFF and XON. Flow control operates independently for each direction of data transmission.
The synchronous control function is:
End-of-file indication.
The following table describes the character codes that represent these control functions.
In the above table, the character xe2x80x9c{circumflex over ( )}xe2x80x9d is also known as xe2x80x9cCONTROLxe2x80x9d.
These control function character codes must be xe2x80x9cquotedxe2x80x9d to be transmitted as data, so that they are not passed through to the PostScript(trademark) interpreter in the device. Quoting is accomplished by replacing the character code with a two-character sequence comprising a leading character sequence, i.e., {circumflex over ( )}A or Control A (ASCII hex 0xc3x9701), followed by the character associated with the character code XORed with 0xc3x9740.
For example, to send a byte with the value 0xc3x9714 ({circumflex over ( )}T), the two-byte sequence 0xc3x9701 0xc3x9754 ({circumflex over ( )}A T) is sent, since ASCII T is the result of XORing {circumflex over ( )}T with 0xc3x9740. Quoting guarantees that whenever any of the character code for the control functions are received by the device, the control function is performed, regardless of whether the preceding character is a {circumflex over ( )}A. All 8-bit values other than the control function character codes listed in the table above are transmitted by simply sending the value.
After a {circumflex over ( )}A is received, the next character received that is not one of the control function characters must be the result of XORing one of the control function character codes with 0xc3x9740. Receipt of any other character is considered an error in the input. Between the {circumflex over ( )}A and the XORed character, any number of the control function character codes can appear, except for character codes for control functions that are handled synchronously, i.e., {circumflex over ( )}D and {circumflex over ( )}A, which is considered an error.
Use of the binary communications protocol results in a significant performance enhancements. The alternatives for transmitting binary data between devices comprise ASCII hexadecimal for image data (a 1:2 expansion of the data), octal (xe2x80x9c nnnxe2x80x9d) notation for string data (a 1:4 expansion), or ASCII base-85 encoding (a 4:5 expansion). The binary communications protocol offers a 1:1 transmission for most characters, with a 1:2 expansion for the few control function character codes.
However, the binary communications protocol is generally only used when the printer driver (or host application sending the job to the printer) can determine that it is connected directly to a printer that is enabled to support the protocol. This requires, at least, bi-directional communication between the computer and the printer to determine if this protocol has been enabled. This process is so error-prone that the usual advice to programmers is to never try using this protocol. On the other hand, the alternatives recited above consume a great deal of additional bandwidth.
Therefore, there exists a need in the art for a communications technique that provides the most efficient compression but does not require bi-directional communications between devices.
To overcome the limitations in the prior art described above, and to overcome other limitations that will become apparent upon reading and understanding the present specification, the present invention discloses a method, apparatus, and article of manufacture for a computer-implemented method for transmitting data between PostScript(trademark) devices using a Control B protocol. The Control B protocol allows data to be compressed and transmitted to the PostScript(trademark) device without the need of having bi-directional communications between the sending and receiving devices to check for Control B capability or activation. The Control B protocol allows data to be transmitted in binary format, while control functions are represented by quoted character codes, thereby resulting in an efficient use of bandwidth between the devices.